<template>
	<view class="theme-page-bg">
		<block v-for="(item, index) in list2" :key="index">
			<view class="bg-w m-t-20">
				<TimeItem :dataItem="item" />
				<CommissionItem 
					v-for="(commission, idx) in item.detail"
					:key="idx"
					:dataItem="commission">
				</CommissionItem>
			</view>
		</block>
	</view>
</template>

<script setup lang="ts">
	import requestHttp from '@/providers/essential/httpService.js'
	import{onLoad}from'@dcloudio/uni-app';
	import { ref,reactive } from 'vue';
	import TimeItem from '@/components/accompany/tabbar/my/timeItem/timeItem.vue';
	import CommissionItem from '@/components/accompany/tabbar/my/commissionItem/commissionItem.vue';
	let list2=reactive(
        [{
            "month": "2023年09月",
            "total_amount": 220,
            "detail": [
                {
                    "month": "2023年09月",
                    "id": 1,
                    "remark": null,
                    "creator": "1",
                    "create_time": 1694066946000,
                    "updater": "1",
                    "update_time": 1694066946000,
                    "deleted": false,
                    "tenant_id": 1,
                    "merchant_id": 2,
                    "order_reservation_id": 127,
                    "commission_account": 90
                },
                {
                    "month": "2023年09月",
                    "id": 2,
                    "remark": null,
                    "creator": "1",
                    "create_time": 1694067019000,
                    "updater": "1",
                    "update_time": 1694067019000,
                    "deleted": false,
                    "tenant_id": 1,
                    "merchant_id": 2,
                    "order_reservation_id": 127,
                    "commission_account": 10
                },
                {
                    "month": "2023年09月",
                    "id": 3,
                    "remark": null,
                    "creator": "1",
                    "create_time": 1694088784000,
                    "updater": "1",
                    "update_time": 1694088784000,
                    "deleted": false,
                    "tenant_id": 1,
                    "merchant_id": 2,
                    "order_reservation_id": 127,
                    "commission_account": 10
                },
                {
                    "month": "2023年09月",
                    "id": 4,
                    "remark": null,
                    "creator": "1",
                    "create_time": 1694088831000,
                    "updater": "1",
                    "update_time": 1694088831000,
                    "deleted": false,
                    "tenant_id": 1,
                    "merchant_id": 2,
                    "order_reservation_id": 127,
                    "commission_account": 10
                },
                {
                    "month": "2023年09月",
                    "id": 5,
                    "remark": null,
                    "creator": "1",
                    "create_time": 1694088848000,
                    "updater": "1",
                    "update_time": 1694088848000,
                    "deleted": false,
                    "tenant_id": 1,
                    "merchant_id": 2,
                    "order_reservation_id": 127,
                    "commission_account": 10
                },
                {
                    "month": "2023年09月",
                    "id": 6,
                    "remark": null,
                    "creator": "1",
                    "create_time": 1694088865000,
                    "updater": "1",
                    "update_time": 1694088865000,
                    "deleted": false,
                    "tenant_id": 1,
                    "merchant_id": 2,
                    "order_reservation_id": 127,
                    "commission_account": 90
                }
            ]
        },
        {
            "month": "2023年08月",
            "total_amount": 90,
            "detail": [
                {
                    "month": "2023年08月",
                    "id": 7,
                    "remark": null,
                    "creator": "1",
                    "create_time": 1690892067000,
                    "updater": "1",
                    "update_time": 1697266861000,
                    "deleted": false,
                    "tenant_id": 1,
                    "merchant_id": 2,
                    "order_reservation_id": 127,
                    "commission_account": 90
                }
            ]
        }
    ]
)
	onLoad (() => {
		requestHttp.getData('/magic/web/app/pay/merchant/get/my/commission', {

		}).then((res) => {
			list2=res.data
		})
	})
</script>

<style lang="scss" scoped>
	page {
		background-color: #F5F7FB;
	}
</style>
